//#pragma once
#include <iostream>
#include <vector>

typedef void (*task_t)();

void func()
{
    std::cout << "普通指令" << std::endl;
}

void print()
{
    std::cout << "Print" << std::endl;
}

void haha()
{
    std::cout << "HAHA" << std::endl;
}

class Task
{
public:
    Task(task_t newtask)
        :_task(newtask)
    {
        ;
    }
    ~Task(){}

    task_t Value()
    {
        return _task;
    }


private:
    task_t _task;
};

class Tasks
{
public:
    Tasks()
    {
        Insert(&func);
        Insert(&print);
        Insert(&haha);
    }
    ~Tasks(){}

    void Insert(task_t key)
    {
        _tasks.emplace_back(key);
    }

    Task& operator [] (size_t i)
    {
        return _tasks[i];
    }

    int size()
    {
        return _tasks.size();
    }


private:
    std::vector<Task> _tasks;
};